/*--------------------------------------------------------------
 * File: demo43.c 编码类型：C语言  UTF-8
 * Author WRS (1352509846@qq.com)
 * 功能: 输出数组
 * 使用for循环迭代输出元素，并将各个元素相加，再除以元素个数
 * Version 0.1
 * Date 2022-05-21 
 * 
 * @copyright Copyright (c) 2022
 * 
----------------------------------------------------------------*/
#include <stdio.h>

int main(int argc, char const *argv[])
{
    int array[10] = {1,2,3,4,5,6,7,8,9,0};
    int sum = 0;
    int i = 0;

    for(i = 0; i<10; i++)
    {
        sum += array[i];
        printf("array[%d] = %d\n",i,array[i]);
    }

    printf("avg = %f",(float)sum/10);

    return 0;
}

